<template>
	<view class="content">
		<view class="header">我的资产</view>
		<view class="yue_box">
			<view class="wode_yue_box">我的余额</view>
			<view class="bot_box">
				<view class="left_box">
					<view class="top_txt">{{ walletData.integral || 0.00 }}</view>
					<view class="bot_txt">开盒或购物时，1大王币可折扣1元现金</view>
				</view>
				<view class="right_box" @click="goRecharge">充值</view>
			</view>
		</view>
		<view class="mingxi" @click="gotoyue">余额明细</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			walletData: {
				integral:'',//余额
				
			}
		};
	},
	onShow() {
		this.getwallet()
	},
	onNavigationBarButtonTap(e) {
		uni.navigateTo({
			url: "/userPage/user/rechangemingxi"
		})
	},
	onPullDownRefresh() {
		this.walletData = {}
		this.getwallet()
	},
	methods: {
		gotoyue() {
			uni.navigateTo({
				url: '/userPage/user/rechangemingxi',
			})
		},
		getwallet() {
			this.$Request.get(this.$api.user.wallet).then(res => {
				this.walletData = res.data
				setTimeout(function () {
					uni.stopPullDownRefresh();
				}, 1000);
				clearTimeout();
			});
		},
		goRecharge() {
			uni.navigateTo({
				url: "/userPage/user/balance"
			})
		},
		entertype(type) {
			if (type == 1) {
				uni.redirectTo({
					url: "/userPage/user/order/mystore"
				})
			} else {
				uni.navigateTo({
					url: "/userPage/user/pdgive"
				})
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.content {
	min-height: 100vh;
	background: #262626;
	padding-top: 18rpx;

	.header {
		padding-left: 16rpx;
		width: 100%;
		height: 52rpx;
		font-size: 40rpx;
		font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
		font-weight: 400;
		color: #FFAE2A;
		line-height: 52rpx;
		margin-bottom: 16rpx;
	}

	.yue_box {
		width: 706rpx;
		height: 240rpx;
		background: rgba(255, 231, 192, 0.1);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		opacity: 1;
		border: 2rpx solid #FED187;
		margin: auto;
	}

	.wode_yue_box {
		margin: auto;
		width: 100%;
		height: 114rpx;
		line-height: 114rpx;
		font-size: 40rpx;
		font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
		font-weight: 400;
		color: #FFFFFF;
		padding-left: 28rpx;
	}

	.bot_box {
		margin: auto;
		width: 100%;
		height: 126rpx;
		padding-left: 28rpx;
		display: flex;
		justify-content: space-between;

		.left_box {
			width: 400rpx;
			height: 126rpx;

			.top_txt {
				width: 100%;
				height: 58rpx;
				font-size: 44rpx;
				font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
				font-weight: 400;
				color: #FFAE2A;
				line-height: 58rpx;
			}

			.bot_txt {
				width: 100%;
				height: 32rpx;
				font-size: 24rpx;
				font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 32rpx;
			}

		}

		.right_box {
			width: 170rpx;
			height: 60rpx;
			background: rgba(0, 0, 0, 0.1);
			box-shadow: inset 0rpx 0rpx 20rpx 0rpx rgba(255, 159, 0, 0.4);
			border-radius: 60rpx 60rpx 60rpx 60rpx;
			opacity: 1;
			border: 1rpx solid #FFAE2A;
			font-size: 40rpx;
			font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
			font-weight: 400;
			color: #FFFFFF;
			line-height: 60rpx;
			margin-right: 50rpx;
			text-align: center;
		}
	}

	.mingxi {
		width: 706rpx;
		height: 84rpx;
		background: rgba(255, 231, 192, 0.1);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		opacity: 1;
		border: 2rpx solid #FED187;
		margin: 28rpx auto;
		padding-left: 26rpx;
		font-size: 40rpx;
		font-family: YouSheBiaoTiHei-Bold, YouSheBiaoTiHei;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 84rpx;
	}
}
</style>